﻿@model string
<div class="main">
    <form method="post" class=" form form-lg ui-validForm" action="@Url.ActionUrl()" data-source="@Model">
        <div class="form-group">
            <label class="control-label">方案名称</label>
            <div class="controls">
                <input name="Name" id="Name" type="text" maxlength="50" class="form-control form-control-sm" data-validate="dataType:'*',nullMsg:'请填写方案名称!',checkUrl:'@Url.Action("CheckExists",new {id=Request.QueryString["id"],fieldName = "方案名称",area="admin"})'">
                <span class="help-block">请填写方案名称</span>
            </div>
        </div>


        <div class="form-group">
            <label class="control-label">选择权限用户组</label>
            <div class="controls">
                <select id="MemberGroupIds" name="MemberGroupIds" class="form-control ui-convertData multiple-select" multiple="" style="display:block;height:120px;" data-custom-params="url:'/admin/MemberGroup/LoadListByIds/',textField:'Name'" data-source=""></select>
                <div class="btn-group btn-group-sm">
                    <a href="javascript:void(0)" class="btn btn-default btn-sm ui-dialog" data-custom-params="title:'选择用户组',url:'/admin/MemberGroup/Select/?objname=#MemberGroupIds',width:'600px',height:'90%',target:'self'">选择用户组</a>
                    <a href="javascript:void(0)" class="btn btn-default btn-sm ui-removeSelectedOptions" title="按住Ctrl键可实现多选" data-custom-params="obj:'#MemberGroupIds'">删除选中</a>
                </div>
                <span class="help-block">不选择则默认不对用户组进行限制。</span>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label">选择权限部门</label>
            <div class="controls">
                <select id="DepartmentIds" name="DepartmentIds" class="form-control ui-convertData  multiple-select" multiple="" style="display:block;height:120px;" data-custom-params="url:'/admin/Department/LoadListByIds/',textField:'Name',onlySelectFinal:true"></select>
                <div class="btn-group btn-group-sm">
                    <a href="javascript:void(0)" class="btn btn-default btn-sm ui-dialog" data-custom-params="title:'选择部门',url:'/admin/Department/Select/?objname=#DepartmentIds',width:'80%',height:'90%',target:'self'">选择部门</a>
                    <a href="javascript:void(0)" class="btn btn-default btn-sm ui-removeSelectedOptions" title="按住Ctrl键可实现多选" data-custom-params="obj:'#Login_DepartmentIds'">删除选中</a>
                </div>
                <span class="help-block">不选择则默认不对部门进行限制。</span>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label">允许的Ip</label>
            <div class="controls">
               <input name="AccessIps" id="AccessIps" type="text" maxlength="100" class="form-control form-control-md">
                <span class="help-block">多个ip用半角逗号隔开，支持正则匹配，如：192\.168\.*匹配所有192.168.开头的ip，不设置则默认所有ip有权限</span>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label">禁止的Ip</label>
            <div class="controls">
                    <input name="ForbidIps" id="ForbidIps" type="text" maxlength="100" class="form-control form-control-md">
                    <span class="help-block">多个ip用半角逗号隔开，支持正则匹配，不设置则默认不限制</span>
            </div>
        </div>

        <div class="submit-footerbar">
            <label class="control-label"></label>
            <div class="controls">
                <input type="hidden" id="Id" name="Id" />
                <button type="button" class="btn btn-sm btn-primary ui-pagePost" data-custom-params="url:'@Url.ActionUrl()',callBack:'PostRefreshBack'">提交</button>
                <button type="button" class="btn btn-sm btn-default ui-closeDialog">关闭</button>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
    //绑定数据
    var id = Request("id");
    if (id != "") {
        $("form").FormBind({ dataSourceFrom: "attr" })
    }
</script>